import Vue from 'vue'
// import store from './store'
import Router from 'vue-router'
import Home from './views/Home.vue'
const articlePage = () => import('./components/index/article_tuijian_detail.vue')
const articleTuiJian = () => import('./components/index/article_tuijian.vue')
const articleGuanZhu = () => import('./components/index/article_guanzhu.vue')
const articleSheHui = () => import('./components/index/article_shehui.vue')
const articleJiaTing = () => import('./components/index/article_jiating.vue')
const articleRenWen = () => import('./components/index/article_renwen.vue')
const articleGanQing = () => import('./components/index/article_ganqing.vue')
const articleLiShi = () => import('./components/index/article_lishi.vue')
const findIndex = () => import('./components/find/find_index.vue')
const findMain = () => import('./components/find/find_main.vue')
const findHealth = () => import('./components/find/find_healthy_618.vue')
const findMother = () => import('./components/find/find_mother.vue')
const findMotherResultA = () => import('./components/find/find_mother_result/find_result_a.vue')
const findMotherResultB = () => import('./components/find/find_mother_result/find_result_b.vue')
const findMotherResultC = () => import('./components/find/find_mother_result/find_result_c.vue')
const findMotherResultD = () => import('./components/find/find_mother_result/find_result_d.vue')
const logPage = () => import('./views/logIndex.vue')
const mall = () => import('./views/mall.vue')
const mallIndex = () => import('./components/mall/mall_index.vue')
const mallNav = () => import('./components/mall/mall_navs.vue')
const mallPuShuo = () => import('./components/mall/mall_pushuo.vue')

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: Home,
      children: [
        {
          name: 'articleTuiJian',
          path: '',
          component: articleTuiJian,
          meta: {
            requireAuth: true
          },
          beforeEnter: (to, from, next) => {
            next()
          }
        },
        {
          name: 'articleGuanZhu',
          path: 'GuanZhu',
          component: articleGuanZhu
        },
        {
          name: 'articleSheHui',
          path: 'SheHui',
          component: articleSheHui,
          beforeEnter: (to, from, next) => {
            next()
          }
        },
        {
          name: 'articleJiaTing',
          path: 'JiaTing',
          component: articleJiaTing,
          beforeEnter: (to, from, next) => {
            next()
          }
        },
        {
          name: 'articleRenWen',
          path: 'RenWen',
          component: articleRenWen,
          beforeEnter: (to, from, next) => {
            next()
          }
        },
        {
          name: 'articleGanQing',
          path: 'GanQing',
          component: articleGanQing,
          beforeEnter: (to, from, next) => {
            next()
          }
        },
        {
          name: 'articleLiShi',
          path: 'LiShi',
          component: articleLiShi,
          beforeEnter: (to, from, next) => {
            next()
          }
        }
      ]
    },
    {
      path: '/find',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Find.vue'),
      children: [
        {
          path: '',
          name: 'findIndex',
          component: findIndex
        },
        {
          path: 'findHealth',
          name: 'findHealth',
          component: findHealth
        },
        {
          path: 'findMain',
          name: 'findMain',
          component: findMain
        },
        {
          path: 'findMother',
          name: 'findMother',
          component: findMother
        },
        {
          path: 'findMother/findMotherResultA',
          name: 'findMotherResultA',
          component: findMotherResultA
        },
        {
          path: 'findMother/findMotherResultB',
          name: 'findMotherResultB',
          component: findMotherResultB
        },
        {
          path: 'findMother/findMotherResultC',
          name: 'findMotherResultC',
          component: findMotherResultC
        },
        {
          path: 'findMother/findMotherResultD',
          name: 'findMotherResultD',
          component: findMotherResultD
        }
      ]
    },
    {
      path: '/mall',
      component: mall,
      children: [
        {
          path: '',
          name: 'mallIndex',
          component: mallIndex
        },
        {
          path: 'mallNav',
          name: 'mallNav',
          component: mallNav
        },
        {
          path: 'mallPuShuo',
          name: 'mallPuShuo',
          component: mallPuShuo
        }
      ]
    },
    {
      name: 'logPage',
      path: '/logPage',
      component: logPage
    },
    {
      path: '/articlePage/:articleDetail',
      name: 'articlePage',
      component: articlePage
    }
  ]
})
